#ifndef __SKILL_H__
#define __SKILL_H__

class PacketDecoder;

typedef Int32 SkillId;
#pragma pack(1)

struct SkillCSVInfo
{
	Int32			id;
	Int32			type;
	std::string		name;
	std::string		kind;
	std::string		description;
	Int32			icon_id;
	Int32			require_level;
	Int32			require_gender;

	Int32			action_self;
	Int32			action_target;
	Int32			effect_self;
	Int32			effect_self_fullscreen;
	Int32			effect_target_attacked;
	Int32			effect_target_hit;

	SkillCSVInfo()
	{
		id = 0;
		type = 0;
		name = "";
		kind = "";
		description = "";
		icon_id = 0;
		require_level = 0;
		require_gender = 0;

		action_self = 0;
		action_target = 0;
		effect_self = 0;
		effect_self_fullscreen = 0;
		effect_target_attacked = 0;
		effect_target_hit = 0;
	}
};
class Player;
class Skill
{
public:
	enum
	{
		SKILL_TYPE_JD = 1,				
		SKILL_TYPE_FY = 2,	
		SKILL_TYPE_TP = 3,
		SKILL_TYPE_HF = 4,
		SKILL_TYPE_TG = 5,
		SKILL_TYPE_HL = 6,
		SKILL_TYPE_BD = 7,
		SKILL_TYPE_HS = 8,
		SKILL_TYPE_SL = 9,
		SKILL_TYPE_JZ = 10,
		SKILL_TYPE_SD = 11,
		SKILL_TYPE_QS = 12,
		SKILL_TYPE_CF = 13,
		SKILL_TYPE_JS = 14,
	};
public:
	Skill();
	Skill(SkillId nSkillId);
	virtual ~Skill();
	void SetSkillId(SkillId nSkillId){m_nSkillId = nSkillId;};
	SkillId GetSkillId(){ return m_nSkillId;};
	void SetSkillInfo(SkillInfo& info);
	SkillInfo& GetSkillInfo(){return m_stSkillInfo;}
	void SetSkillCSVInfo(SkillCSVInfo* pCSVInfo);
	SkillCSVInfo* GetSkillCSVInfo(){return m_pSkillCSVInfo;}
	void Update(Player* pPlayer);
	Int32 m_nLevelUpMoney;
	Int32 m_nTargetCount;
	Int32 m_nRoundCount;
	Int32 m_nSuccessRate;
	Int32 m_nConsumeHPRate;
private:
	SkillId			m_nSkillId;
	SkillInfo		m_stSkillInfo;
	SkillCSVInfo*    m_pSkillCSVInfo;
};
#pragma pack()
#endif